package com.dxy.user.controller;

import com.dxy.common.pojo.Resource;
import com.dxy.common.vo.Result;
import com.dxy.user.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ResourceController {

    @Autowired
    private ResourceService resourceService;

    @GetMapping("/findUserResource/{userId}")
    public Result<List<Resource>> findUserResource(@PathVariable("userId") Integer userId) {
        List<Resource> resourceList = resourceService.findUserResource(userId);
        return Result.ok(resourceList);
    }
}
